package com.yuantu.judiciary.dao;

import com.yuantu.judiciary.model.domain.UserFollowDO;
import com.yuantu.judiciary.model.enums.UserFollowType;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * 用户关注
 *
 * @author syw
 * @since 2023-07-27
 **/
public interface IUserFollowDao extends JpaRepository<UserFollowDO, Long> {

    UserFollowDO findByEntityIdAndCreatorIdAndDeletedFalse(Long entityId, Long creatorId);

    Page<UserFollowDO> findByCreatorIdAndTypeAndDeletedFalse(Long creatorId, UserFollowType type, Pageable pageable);

    Integer countDistinctByCreatorIdAndDeletedFalse(Long creatorId);

    List<UserFollowDO> findByCreatorIdAndDeletedFalse(Long creatorId);

}
